package com.swak.utils;

/**
 * Chars.
 * 
 * @author 618lf
 */
public class Chars {

	public static byte[] toByteArray(char value) {
		return new byte[] { (byte) (value >> 8), (byte) value };
	}

	public static char fromByteArray(byte[] bytes) {
		return fromBytes(bytes[0], bytes[1]);
	}

	public static char fromBytes(byte b1, byte b2) {
		return (char) ((b1 << 8) | (b2 & 0xFF));
	}
}
